<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>招标发布</title>
    <link th:href="@{/layui/css/layui.css}" rel="stylesheet"/>
    <link th:href="@{/css/index.css}" rel="stylesheet"/>
    <link th:href="@{/css/tool.css}" rel="stylesheet"/>
    <!-- 图标  -->
    <link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_1531710_xb357ub1wmg.css"/>
    <script th:src="@{/layui/layui.js}" type="text/javascript"></script>
    <script th:src="@{/js/marked.min.js}" type="text/javascript"></script>
</head>
<body>
<div th:insert="~{navigation::nav}"></div>
<div class="layui-fluid main">
    <div class="layui-row layui-col-space10">
        <div class="layui-col-lg9">
            <h1>投标文件上传</h1>
            <hr>
            <form class="layui-form" th:action="@{'/tb/fileInsert/'+${tbInfo.id}}" method="post">
                <input type="hidden" name="id" th:value="${tbInfo.id}">
                <input type="hidden" name="FileId" id="FileId">
                <div class="layui-form-item marginTop15px">
                    <label class="layui-form-label">投标文件上传</label>
                    <div class="layui-upload">
                        <button type="button" class="layui-btn layui-btn-normal" id="fileChoose">选择文件</button>
                        <button type="button" class="layui-btn" id="fileUpload">开始上传</button>
                    </div>
                </div>

                <div class="layui-form-item marginTop15px">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit>立即提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>

            <form action="/zb_modify" method="post" th:if="${tbInfo.fileId!=null}">
                <input type="hidden" th:value="${id}" id="zbId" name="zbId">
                <input type="hidden" th:value="${tbInfo.id}" id="tbId" name="tbId">
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">修改内容</label>
                    <div class="layui-input-block">
                     <textarea name="modifyContent" lay-verify="required" placeholder="请输入需要修改的内容，包括原文和修改后的内容"
                               class="layui-textarea editor"></textarea>
                    </div>
                </div>

                <div class="layui-form-item marginTop15px">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="sub">立即提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>

        </div>

        <div class="layui-col-lg3">
            <h1>小提醒</h1>
            <hr>
            <h3>1.仔细阅读招标文件，并按要求制作投标文件</h3>
            <div>&nbsp;</div>
            <h3>2.如果需要对标书的内容进行补充和澄清请遵循以下原则：
                <br>
                ·未发生较大的修改和补充时，只需要提交补充和澄清申请
                <br>
                ·若发生较大的修改和补充，则应该重新上传投标文件，并注意投标文件的命名加上版本号。

            </h3>

        </div>
    </div>
</div>

<script type="text/javascript">
    layui.use(['form', 'laydate', 'upload', 'element', 'jquery'], function () {
        var form = layui.form
            , laydate = layui.laydate
            , upload = layui.upload
            , $ = layui.jquery;

        //选完文件后不自动上传
        upload.render({
            elem: '#fileChoose'
            , url: '/file/upload/2' //招标上传接口
            , auto: false
            , accept: 'file'
            //,multiple: true
            , bindAction: '#fileUpload'
            , done: function (res) {
                if (res.code == 200) {
                    layer.msg('上传成功');
                    $('#FileId').val(res.fileId);
                }
                console.log(res)
            }
        });

    });
</script>
</body>
</html>